﻿package org.liveboardgames.common.dictionary.enum.core
{

    /**
     * The <code>IComparable</code> interface defines methods for comparing objects.
     *
     * @see IHashable
     */
    public interface IComparable
    {

        /**
         * Indicates whether some other object is equal to this
         * <code>IComparable</code>.
         *
         * <p>When you implement this method, be aware that equality is an equivalence relation. It means that
         * your override of that method must be :
         * <ul>
         * <li>reflexive : x = x is true.</li>
         * <li>symmetric : x = y <=> y = x;</li>
         * <li>transitive : x = y and y = z => x = z</li>
         * <li>consistent : calling equals multiple times always return the
         * same result, provided the parameters used in have not changed.</li>
         * </ul></p>
         *
         * <p>Additonally, for any <code>x:IComparable</code>, if <code>object</code> is
         * <code>null</code>, <code>x.equals(null)</code> must return <code>false</code>.</p>
         *
         * <p>If the class implementing <code>IComparable</code> also implements <code>IHashable</code>
         * you typically use the <code>hashcode</code> method of this class in this method.</p>
         *
         * @param object The object with which to compare.
         * @return <code>true</code> if this <code>IComparable</code> is the
         * same as the <code>object</code> argument. <code>false</code> otherwise.
         */
        function equals(object:*):Boolean;
    }
}
